var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
    })(t, e);
}, function(t, e) {
    function i() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, 
    new i());
}), a = this && this.__decorate || function(t, e, i, o) {
    var r, n = arguments.length, s = n < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, i) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(t, e, i, o); else for (var h = t.length - 1; 0 <= h; h--) (r = t[h]) && (s = (n < 3 ? r(s) : 3 < n ? r(e, i, s) : r(e, i)) || s);
    return 3 < n && s && Object.defineProperty(e, i, s), s;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = cc._decorator, s = r.ccclass, c = r.property, l = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.graphics = null, t.leftSprite = null, t.rightSprite = null, t.pos = null, 
        t.dir = null, t.len = 0, t.angle = 90, t.time = 1.2, t;
    }
    return i(t, e), t.prototype.start = function() {}, t.prototype.doInit = function(t) {
        this.pos = t.pos, this.dir = t.dir, t.time && t.time != this.time && (this.time = t.time);
    }, t.prototype.doReset = function() {
        this.pos = null, this.dir = null, this.len = 0, this.angle = 90;
    }, t.prototype.doUpdate = function(t) {
        null != this.pos && null != this.dir && null != this.graphics && (0 < this.angle ? (this.angle -= 90 * t / this.time, 
        this.len += 1200 * t / this.time) : this.angle = 0, this.angle < 0 && (this.angle = 0), 
        this.graphics.clear(), this.graphics.circle(this.pos.x, this.pos.y, this.len), this.graphics.stroke(), 
        this.leftSprite.node.setPosition(this.pos), this.rightSprite.node.setPosition(this.pos), 
        t = cc.misc.radiansToDegrees(Math.atan2(this.dir.y, this.dir.x)) - 90, this.leftSprite.node.angle = this.angle + t, 
        this.rightSprite.node.angle = -this.angle + t, this.leftSprite.node.height = this.rightSprite.node.height = this.len);
    }, a([ c(cc.Graphics) ], t.prototype, "graphics", void 0), a([ c(cc.Sprite) ], t.prototype, "leftSprite", void 0), 
    a([ c(cc.Sprite) ], t.prototype, "rightSprite", void 0), a([ s ], t);
}(cc.Component);

n.default = l;